package com.server.http.handler.impl;

import com.server.conditionenum.HttpReturnStatus;
import com.server.db.DataBaseManager;
import com.server.http.handler.HttpHandler;
import com.server.http.request.HttpRequestMessage;
import com.server.http.response.HttpResponseMessage;
import com.server.mine.net.HttpProtocol;

public class JudgeName extends HttpHandler{
	@Override
	public void handle(HttpRequestMessage request, HttpResponseMessage response) {
		String pname = request.getParameter("pname");
		boolean state = true;
		if(!(pname == null || pname == "")) {
			state = DataBaseManager.GetInstance().JudgeName(pname);
		}
		SetReturnData(response,state?1:0,HttpProtocol.JUDGENAME,HttpReturnStatus.Successed);
	}
}
